import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.Naming;
import javax.swing.Timer;

public class Test {

	protected static SvMon mon;

	public static void test() {
		try {
			System.out.println("OS name: " + mon.osName());
			System.out.println("kernel version: " + mon.kernelVersion());

			System.out.println();

			System.out.println("Uptime in seconds: " + mon.uptimeInSeconds());

			System.out.println("cpu model " + mon.cpuModel() + "\tCores: "
			        + mon.cpuNum());

			System.out.println("Cpu frequency: ");
			System.out.println(mon.cpuFrequency());

			System.out.println("cpu load: ");
			System.out.println(mon.cpuLoad());

			System.out.println("cpu cores' frequencies: ");
			System.out.println(mon.cpuCoreFrequency());

			System.out.println("RAM?: " + mon.physical());

			System.out.println("Swap: " + mon.swap());
		} catch (RemoteException re) {
			re.printStackTrace();
		}

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {

		Object o = Naming.lookup("monitor");
		ISvMon mon = ((ISvMon)o);
		System.out.println(mon.osName());

	}

}
